import http from "@/request/http.js";

export default {
    // 推荐歌单：使用 http.get 简化调用
    getRecommended: () => http.get('/playlist/getRecommendedPlaylists'),

    // 歌单详情：使用 http.get 并保留参数验证
    getPlaylistDetail: (playlistId) => {
        if (!playlistId || isNaN(Number(playlistId))) {
            return Promise.reject(new Error('无效的歌单ID'))
        }
        // 使用 http.get 确保走全局配置
        return http.get(`/playlist/getPlaylistDetail/${playlistId}`)
    }
}
